Feature/nayara dark mode UI#33
Conversation
- Atualiza App.tsx, JobsHeaderCard.tsx e JobsFiltersCard.tsx com melhorias visuais e estruturais - Refatora componentes compartilhados (ui/button.tsx, ui/theme-toggle.tsx) - Ajusta estilos globais em index.css (cores, tema e consistência visual) - Adiciona novo logotipo (logo-painel-vagas.svg) para o cabeçalho
- JobsFiltersCard: - Move ações do cabeçalho e exibição de metadados para este card. - Busca em linha com ações. - Seleção de palavra-chave e arquivo reorganizada. - JobsHeaderCard: - Simplificado para exibir apenas logotipo e alternância de tema. - Remove importação não utilizada do ThemeToggle. - JobsTableCard: - Adiciona margem inferior e espaçamento para banner de erro. - Reordena colunas da tabela: palavra-chave e fonte para o final. - Ajusta cor do link no modo escuro. - CSS/Tailwind: - Ajusta a cor do anel (--ring) para foco.
… feature/nayara-dark-mode-ui
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend UI to better support a new dark-mode visual identity, including refreshed theme colors and a restructured header/filters layout.
Changes:
- Updated CSS theme tokens (light/dark) and refined global body styling.
- Refactored the header/filters composition: moved meta badges/actions into
JobsFiltersCardand introduced a logo-based header with an in-header theme toggle. - Tweaked interaction styles (button hover opacity, theme toggle hover state) and table column ordering/styling.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/index.css | Updates theme CSS variables and global body base styles. |
| frontend/src/components/ui/theme-toggle.tsx | Adds hover/transition/rounding styles to the theme toggle button. |
| frontend/src/components/ui/button.tsx | Adjusts default button hover opacity. |
| frontend/src/components/JobsTableCard.tsx | Reorders table columns and tweaks spacing/link styling. |
| frontend/src/components/JobsHeaderCard.tsx | Refactors header into a logo bar with theme toggle and new styling. |
| frontend/src/components/JobsFiltersCard.tsx | Refactors filters layout, adds meta badges and actions slot; changes component props. |
| frontend/src/App.tsx | Updates page layout and rewires header/filters/actions composition. |
| frontend/package-lock.json | Removes workspace-level lockfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import type { JobsMeta } from "@/types/jobs"; | ||
| import { BriefcaseBusiness, FileSpreadsheet } from "lucide-react"; | ||
| import type { ReactNode } from "react"; | ||
| import Logo from "../assets/logo-painel-vagas.svg"; | ||
| import { ThemeToggle } from "@/components/ui/theme-toggle"; | ||
| import { useTheme } from "@/hooks/useTheme"; | ||
|
|
||
| interface JobsHeaderCardProps { | ||
| meta: JobsMeta; | ||
| actions?: ReactNode; | ||
| } |
There was a problem hiding this comment.
JobsHeaderCardProps (and the JobsMeta / ReactNode imports) are now unused after changing JobsHeaderCard to take no props. With the current ESLint rule @typescript-eslint/no-unused-vars, this will fail lint. Either remove the unused interface/imports, or restore the component props and use them.
| <> | ||
| <div className="w-screen bg-[#004726] dark:bg-[#003318] p-6 -mx-8 flex items-end"> | ||
| <CardTitle className="text-3xl text-white"> | ||
| <img src={Logo} /> |
There was a problem hiding this comment.
JobsHeaderCard now renders a logo image without an alt attribute. Add meaningful alt text (or alt="" if decorative) to avoid accessibility issues for screen readers.
| <img src={Logo} /> | |
| <img src={Logo} alt="Painel Vagas logo" /> |
| <CardTitle className="text-3xl">Painel de Vagas</CardTitle> | ||
| <CardDescription>Leitura automatica dos arquivos XLSX gerados em output.</CardDescription> | ||
| <> | ||
| <div className="w-screen bg-[#004726] dark:bg-[#003318] p-6 -mx-8 flex items-end"> |
There was a problem hiding this comment.
The header background uses hard-coded hex colors (bg-[#004726] / dark:bg-[#003318]), bypassing the design tokens defined via CSS variables/Tailwind theme. Consider using token-based classes (e.g., bg-primary / bg-background / bg-card) or introducing a dedicated CSS variable so the dark-mode palette stays centralized and adjustable.
| <div className="w-screen bg-[#004726] dark:bg-[#003318] p-6 -mx-8 flex items-end"> | |
| <div className="w-screen bg-primary p-6 -mx-8 flex items-end"> |
| <TableHead>Titulo</TableHead> | ||
| <TableHead>Empresa</TableHead> | ||
| <TableHead>Fonte</TableHead> | ||
| <TableHead>Local</TableHead> | ||
| <TableHead>Link</TableHead> | ||
| <TableHead>Palavra-chave</TableHead> | ||
| <TableHead>Fonte</TableHead> | ||
| </TableRow> |
There was a problem hiding this comment.
This table header now defines 6 columns, but the empty-state row further down still uses a colSpan sized for the previous column count. That will break alignment when there are no results. Update the empty-state TableCell colSpan to match the new 6-column layout.
| target="_blank" | ||
| rel="noreferrer" | ||
| className="text-primary underline-offset-4 hover:underline" | ||
| className="text-primary underline-offset-4 hover:underline dark:text-[#14AE5C]" |
There was a problem hiding this comment.
The link color adds a hard-coded dark:text-[#14AE5C], which bypasses the theme tokens defined via CSS variables and makes future palette changes harder. Prefer adjusting the dark theme --primary (or introducing a token for link color) so text-primary works consistently in both themes.
| className="text-primary underline-offset-4 hover:underline dark:text-[#14AE5C]" | |
| className="text-primary underline-offset-4 hover:underline" |
| } | ||
|
|
||
| export function JobsHeaderCard({ meta, actions }: JobsHeaderCardProps) { | ||
| export function JobsHeaderCard() { |
There was a problem hiding this comment.
JobsHeaderCard no longer accepts meta/actions props, but the repository still has unit tests/usages that render it with those props (e.g. frontend/tests/unit/components/JobsHeaderCard.test.tsx). Update the tests/usages (or keep the props for backward compatibility) to avoid CI failures.
| export function JobsHeaderCard() { | |
| export function JobsHeaderCard(_props: JobsHeaderCardProps) { |
| @@ -14,8 +15,8 @@ interface JobsFiltersCardProps { | |||
| selectedFile: string; | |||
| setSelectedFile: Dispatch<SetStateAction<string>>; | |||
| files: JobFile[]; | |||
| loading: boolean; | |||
| onRefresh: () => void; | |||
| meta: JobsMeta; | |||
| actions?: ReactNode; | |||
| } | |||
There was a problem hiding this comment.
JobsFiltersCard props were changed (removed loading/onRefresh, added required meta and optional actions). The existing unit tests for this component still pass the old props, so they will fail to compile/run. Update the tests to pass meta and assert the new UI/behavior.
| import { Search } from "lucide-react"; | ||
| import type { Dispatch, ReactNode, SetStateAction } from "react"; | ||
|
|
||
| import { BriefcaseBusiness, FileSpreadsheet } from "lucide-react"; |
There was a problem hiding this comment.
There are two separate imports from lucide-react in this file. Consolidating them into a single import keeps imports cleaner and avoids accidental duplication as the icon list grows.
| import { Search } from "lucide-react"; | |
| import type { Dispatch, ReactNode, SetStateAction } from "react"; | |
| import { BriefcaseBusiness, FileSpreadsheet } from "lucide-react"; | |
| import { Search, BriefcaseBusiness, FileSpreadsheet } from "lucide-react"; | |
| import type { Dispatch, ReactNode, SetStateAction } from "react"; |
| <section className="mx-auto flex w-full flex-col gap-6"> | ||
| <JobsHeaderCard /> | ||
|
|
||
| <JobsFiltersCard |
There was a problem hiding this comment.
App now renders JobsHeaderCard without the previous title text/props and moved the primary action into JobsFiltersCard. The existing frontend/tests/unit/pages/App.test.tsx assertions/mocks (e.g., expecting "Painel de Vagas" and mocking useJobsData without scraping/triggerScraper) will need updating to match this new composition, otherwise CI will fail.
test: update JobsHeaderCard tests for accessibility and theme toggle test: enhance JobsFiltersCard tests with meta data and actions fix: update vitest configuration for setup files chore: add vitest setup for matchMedia polyfill
No description provided.